<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="css/index.css" />
		<script src="js/vue.js"></script>
		<script src="js/axios.min.js"></script>
		<script src="js/elementui.js"></script>
	</head>
	<body>
		<div id="app">
			<el-cascader v-model="value" :options="options"></el-cascader>
			<el-button type="primary" @click="addcitydata">加载数据</el-button>
			{{value}}
		</div>
	</body>

	<script>
		new Vue({
			el: '#app',
			data: {
				value: [],
				options: []
			},
			methods: {
				addcitydata() {
					let valueArr = [{
							"value": "hunan",
							"label": "湖南",
							"children": [{
								"value": "changsha",
								"label": "长沙",
							}, {
								"value": "yongzhou",
								"label": "永州",
							}]
						},
						{
							"value": "chonqing",
							"label": "重庆",
							"children": [{
								"value": "chonqing",
								"label": "重庆",
							}]
						},
						{
							"value": "beijing",
							"label": "北京",
							"children": [{
								"value": "beijing",
								"label": "北京",
							}]
						}
					]
					this.options = valueArr
				}
			},
			mounted(){
				this.addcitydata()
			}
		})
	</script>
</html>